import axios from "axios";
import { material_url } from "../api/url";

export interface Material {
  id: number;
  name: string;
  card_id: number;
  elasticModulus: number;
  shearModulus: number;
  poissonRatio: number;
  density: number;
  thermExpanCoeff: number;
  tensionStressLimit: number;
  compressStressLimit: number;
  shearStressLimit: number;
}

export const getMaterials = async (): Promise<{
  code: number;
  status: number;
  msg: string;
  data: Material[];
}> => {
  return axios.get(material_url).then((res: any) => res.data);
};
